package com.yuqiao.read.utils;

import java.io.UnsupportedEncodingException;
import java.util.Base64;

public class Base64Test {
    public static void main(String[] args) throws UnsupportedEncodingException {
        Base64.Decoder decoder = Base64.getDecoder();
        Base64.Encoder encoder = Base64.getEncoder();
        byte[] encode = encoder.encode("feng".getBytes("UTF-16"));
        System.out.println(encode);
        System.out.println(new String(decoder.decode("JXU3NTMwJXU0RTAwJXU4M0Yy")));
    }
}
